﻿

using MediatR;
using RBAC.Common.Domains.RabbitProject;
using RBAC.Common.Dto;
using RBAC.Common.infrastructures.interfaces;
using RBAC.Enum;

namespace RBAC.api.Application.commond.Provincescitiesandcounties
{
    public class countyHandler : IRequestHandler<countyCommond, Rulst>
    {

        private readonly IbaseRpository<county> _county;

        public countyHandler(IbaseRpository<county> county)
        {
            _county = county;
        }

        public async Task<Rulst> Handle(countyCommond request, CancellationToken cancellationToken)
        {
            var list = new Rulst() { Code = (int)Reult.success };


            list.data = _county.Query().Where(x => x.City == request.Xid).ToList();


            return list;

        }
    }
}
